*********************************************************
*  REPLICATION CODES FOR:                               *
*  Baumeister, C., D. Leiva-Leon, and E. Sims:          *
*  "Tracking Weekly State-Level Economic Conditions"    *
*  The Review of Economics and Statistics, 2021         *
*********************************************************

The results were generated using the high-performance
cluster at the Center for Research Computing at the 
University of Notre Dame which means that Matlab versions 
R2020b and R2021a were used at different stages of this 
project.

SUBFOLDERS:

- Folder 'estimation_mixed-frequency_DFM' contains 
  the state-level data set called dataset_current.xlsx
  which is documented in the file data_dictionary.pdf and
  script files for all 50 U.S. states called main_loop#.m. 
  Run the following 3 steps sequentially:  
  1) Run each main_loop#.m file to produce 4 output files
     in xlsx format: FACTORS, FORECASTS, LAMBDA, YHAT
  2) Run main_weekly_state_indexes.m to produce the 
     weekly state-level economic conditions indices and 
     decomposition that will be stored in the BLS_XXX.xlsx 
     files.
  3) Run main_MS_input.m to produce the input required
     for estimation of the Markov-switching model and
     copy the 2 output files, FACTORQ and FACTORQ_forecast,
     into the folder 'estimation_MS_model'.
  
- Folder 'estimation_MS_model' estimates Markov-switching
  models with heterogeneous recessions and expansions for
  each of the 50 U.S. states by running main_EWI.m.
  It produces the Economic Weakness Index (EWI_Feb2021) and
  state-level recession probabilities (RECPROB_factorsQ.xlsx).

- Folder 'figures' contains all the figures shown in the
  paper, the estimation output from the other two folders,
  and the code to generate the figures in the subfolders 
  called 'figureX'. The function produce_figureX.m 
  plots Figure X.


> All the results reported in the paper are included
  in xlsx and mat files. 

> The subfolder 'functions' contains auxiliary matlab 
  functions used to estimate the models.


*********************************************************
For questions, please contact:
Christiane Baumeister 
cjsbaumeister@gmail.com
*********************************************************